$(function(){
    //防止页面后退
    history.pushState(null, null, document.URL);
    window.addEventListener('popstate', function () {
        history.pushState(null, null, document.URL);
    });
    //渲染页面
    var other = window.localStorage.getItem("Other");
    var score = other.split(",")[0];
    var usedTime = other.split(",")[1];
    if(usedTime!="" && usedTime!=null ){
        $("#usedTime").text("时间： "+usedTime+"");
    }
    var isPass = other.split(",")[2];
    if(isPass==1){
        $("#examResult").text("通过");
    }else{
        $("#examResult").text("未通过");
        $(".resultBox").css('background-image','url("/mp/images/bg01grey.png")');
        $(".bigCircle").css('background-image','url("/mp/images/bg02grey.png")');
        $("#scoreBox").css('background-image','url("/mp/images/bg03grey.png")');
    }
    var data = JSON.parse(window.localStorage.getItem("answerItem"));
    $("#score").html(score+"<span class='fsSmall26'>/"+data.length+"</span>");
    $("body").on("click",".timuBox li",function () {
        var orderId = parseInt($(this).text());
        location.href = "/view/mp/mp-answer-detail?orderId="+orderId;
    });
    for(var i=0;i<data.length;i++){
        var detailId = i;
        var hisOption = data[i].hisOption;
        var questionAnswer =data[i].questionAnswer;
        var orderId = i+1;
        if(hisOption==""||hisOption==null){
            $("#everyQuestion").append("<li class='weidaTi iphoneModel' value='"+detailId+"'>"+orderId+"</li>");
        }else{
            if(hisOption==questionAnswer){
                $("#everyQuestion").append("<li class='correctTi iphoneModel' value='"+detailId+"'>"+orderId+"</li>");
            }else{
                $("#everyQuestion").append("<li class='wrongTi iphoneModel' value='"+detailId+"'>"+orderId+"</li>");
            }
        }
    }






});